import requests
import re

url = 'https://pic.netbian.com/new/'

headers = {
    'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36',
    'referer': 'https://pic.netbian.com/4kyouxi/',
    'Cookie': 'RcGFvecookieztrecord=%2C294%2C; RcGFvecookieclassrecord=%2C55%2C'
}

response = requests.get(url, headers=headers)
print(response.status_code)
# print(response.content.decode('gbk'))

data = response.content.decode('gbk')
# data_re = re.findall(r' <li>\s*<a href="/tupian/\d{5}.html" target="_blank">\s*<img src="(.*?)".*?<b>(.*?)/>\s*</b></a></li>', data, re.S)

data_re = re.findall(r'<li>\s*<a href="/tupian/\d{5}\.html" target="_blank">\s*<img src="(.*?)" .*?>\s*<b>(.*?)</b>\s*</a>\s*</li>', data, re.S)
print(len(data_re))
for item in data_re:
    print('https://pic.netbian.com/new'+item[0])
    img_url = 'https://pic.netbian.com/new'+item[0]
    img_res = requests.get(img_url, headers=headers)
    print(img_res.content.decode('utf8'))

    break